<?php
class SimpleControl {
    protected $command = [];
    //不同的键对应不同的命令
    public function setCommand(int $key, Command $command) {
        $this->command[$key] = $command;
    }
    public function pressButton($key)
    {
        echo isset($this->command[$key]) ? $this->command[$key]->execute() : '没有命令';
        echo "<br>";
    }
}